# Maintainer: David Runge <dvzrv@archlinux.org>

pkgname=libspecbleach
pkgver=0.1.6
pkgrel=2
pkgdesc="C library for audio noise reduction"
arch=(loong64 x86_64)
url="https://github.com/lucianodato/libspecbleach"
license=(LGPL2.1)
depends=(
  glibc
)
makedepends=(
  fftw
  meson
)
provides=(libspecbleach.so)
source=($url/archive/v$pkgver/$pkgname-v$pkgver.tar.gz)
sha512sums=('f6b64e55db556933066a489e2792830a0c34b5bfc365fedb190846ec98292c6e09f07fd2d7bcf97c81a5dfa64e8d66494ff3f2706de63964a222627cb86bfa25')
b2sums=('d3f5afad12afeaedb67fb1196b58ae579b2a8491baf60bb9e2149e9a6f711ba03bb503350f3fe5606a78bae400e03296b66703760a82eb6694aecdea9f8bd770')

build() {
  arch-meson $pkgname-$pkgver build
  meson compile -C build
}

check() {
  meson test -C build
}

package() {
  depends+=(
    fftw libfftw3f.so
  )

  meson install -C build --destdir="$pkgdir"
  install -vDm 644 $pkgname-$pkgver/README.md -t "$pkgdir/usr/share/doc/$pkgname/"
  install -vDm 644 $pkgname-$pkgver/example/* -t "$pkgdir/usr/share/doc/$pkgname/example/"
}
